import json
import requests
from lxml import etree

headers = {
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36"
}
url = 'https://www.baidu.com/s?wd=粮食&lm=1'
response = requests.get(url, headers=headers, timeout=30, )
   r = response.text
   html = etree.HTML(r, etree.HTMLParser())
   r1 = html.xpath('//h3')
   r2 = html.xpath('//*[@class="c-abstract"]')
   r3 = html.xpath('//*[@class="t"]/a/@href')